package controllers

import (
	"fmt"
	"gitee.com/liuziloong/ga1400gateway/models"
	"github.com/astaxie/beego"
	"time"
)

type SystemController struct {
	beego.Controller
}

//注册资源
func (c *SystemController) Register() {
	c.Data["json"] = models.Register(c.Ctx.Input.RequestBody, c.Ctx.Request.Host)
	c.ServeJSON()
}

//保活资源
func (c *SystemController) Keepalive() {
	fmt.Printf("保活时间：%s\n", time.Now().Format("2006-01-02 15:04:05"))
	c.Data["json"] = models.Keepalive(c.Ctx.Input.RequestBody, c.Ctx.Request.Host)
	c.ServeJSON()
}

//系统时间资源
func (c *SystemController) Time() {
	c.Data["json"] = models.Time()
	c.ServeJSON()
}
